﻿using System;
using System.Collections.Generic;
using System.ServiceModel;
using BusinessObjects.Models;

namespace ServerServices
{
    [ServiceContract(SessionMode = SessionMode.Required, Name = "IAuthentificationService", Namespace = "ServerServices"
        )]
    public interface IAuthentificationService
    {
        /// <summary>
        ///     Validates the users
        /// </summary>
        /// <param name="username">The username.</param>
        /// <param name="password">The password.</param>
        [OperationContract(IsInitiating = true, IsTerminating = false)]
        [FaultContract(typeof (ServiceFault))]
        bool ValidateUser(string login, string password);


        [OperationContract(IsInitiating = false, IsTerminating = true)]
        [FaultContract(typeof (ServiceFault))]
        void Logoff(string user);

        [OperationContract(IsInitiating = false, IsTerminating = false)]
        [FaultContract(typeof (ServiceFault))]
        void AddUser(User user);

        [OperationContract(IsInitiating = false, IsTerminating = false)]
        [FaultContract(typeof (ServiceFault))]
        IEnumerable<User> GetAllUsersForDepartment(int departmentId);

        [OperationContract(IsInitiating = false, IsTerminating = false)]
        [FaultContract(typeof (ServiceFault))]
        IEnumerable<Order> GetAllUsersOrders(int departmentId);

        [OperationContract(IsInitiating = false, IsTerminating = false)]
        [FaultContract(typeof (ServiceFault))]
        Dictionary<Dish, int> GetAllUsersDishesFromDate(int departmentId, DateTime date);

        [OperationContract(IsInitiating = false, IsTerminating = false)]
        [FaultContract(typeof (ServiceFault))]
        IEnumerable<Order> GetAllUsersOrdersFromDate(int departmentId, DateTime date);

        [OperationContract(IsInitiating = false, IsTerminating = false)]
        [FaultContract(typeof (ServiceFault))]
        void DeleteUser(User userInfo);

        [OperationContract(IsInitiating = false, IsTerminating = false)]
        [FaultContract(typeof (ServiceFault))]
        void UpdateUser(User userInfo);

        [OperationContract(IsInitiating = false, IsTerminating = false)]
        [FaultContract(typeof (ServiceFault))]
        void AddDishes(IEnumerable<Dish> dishes, int DepartmentId);

        [OperationContract(IsInitiating = false, IsTerminating = false)]
        [FaultContract(typeof (ServiceFault))]
        void RemoveDishes(IEnumerable<Dish> dishes, int DepartmentId);

        [OperationContract(IsInitiating = false, IsTerminating = false)]
        [FaultContract(typeof (ServiceFault))]
        void UpdateDishes(IEnumerable<Dish> dishes, int DepartmentId);

        [OperationContract(IsInitiating = false, IsTerminating = false)]
        [FaultContract(typeof (ServiceFault))]
        IEnumerable<Dish> GetAllDishesForDepartment(int departmentId);
    }
}